﻿using Microsoft.EntityFrameworkCore;
using RollCall.Data;
using System.Windows;

namespace RollCall
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        public static MyDbContext MyDbContext { get; set; }
        public App()
        {
            if (MyDbContext == null)
            {
                MyDbContext = new MyDbContext();
            }
            if (!System.IO.Directory.Exists("data"))
            {
                System.IO.Directory.CreateDirectory("data");
            }
            //迁移数据库结构到数据库
            MyDbContext.Database.Migrate();
        }
    }
}
